#include "qdialhost.h"



#include "qcommonstruct.h"
#include "qabstractproperty.h"
#include "qpropertyfactory.h"

#include <QSlider>
#include <QVariant>

using namespace SHAREDLIB;

QDialHost::QDialHost(QObject *object):
    QAbstractSliderHost(object)
{

    removeProperty("orientation");
    QAbstractProperty *pro;

    pro=QPropertyFactory::createProperty("Bool");
    if(pro!=NULL)
    {
        pro->setAttribute("name","wrapping");
        pro->setAttribute("property_name",tr("Wrapping"));
        pro->setAttribute("group","Attributes");
        addProperty(pro);
    }

    pro=QPropertyFactory::createProperty("Bool");
    if(pro!=NULL)
    {
        pro->setAttribute("name","notchesVisible");
        pro->setAttribute("property_name",tr("NotchesVisible"));
        pro->setAttribute("group","Attributes");
        addProperty(pro);
    }


    pro=QPropertyFactory::createProperty("Float");
    if(pro!=NULL)
    {
        pro->setAttribute("name","notchTarget");
        pro->setAttribute("property_name",tr("NotchTarget"));
        pro->setAttribute("group","Attributes");
        addProperty(pro);
    }

    appendMemery("wrapping");
    appendMemery("notchesVisible");
    appendMemery("notchTarget");
}

void QDialHost::setWrapping(bool wrapping)
{
    setPropertyValue("wrapping",wrapping);
}

bool QDialHost::wrapping()
{
    return getPropertyValue("wrapping").toBool();
}

void QDialHost::setNotchesVisible(bool notchesVisible)
{
    setPropertyValue("notchesVisible",notchesVisible);
}

bool QDialHost::notchesVisible()
{
    return getPropertyValue("notchesVisible").toBool();
}

void QDialHost::setNotchTarget(float notchTarget)
{
    setPropertyValue("notchTarget",notchTarget);
}

float QDialHost::notchTarget()
{
    return getPropertyValue("notchTarget").toBool();
}
